invalidPackageFormat = "Length of {} is {}, shorter than or not equal to {}"

class InvalidPackageLengthError(Exception):
    """
    Invalid Package Length:
    Not long enough when reading bytes
    """

    def __init__(self, byteLen: int, reqLen: int, typeCls: object):
        """
        Get info from 
        """
        self.byteLen = byteLen
        self.reqLen = reqLen
        self.clsStr = typeCls.__name__
        print(invalidPackageFormat.format(self.clsStr, self.byteLen, self.reqLen))

class DisconnectedError(Exception):
    """
    连接断开
    """
    pass
